package cn.edu.scau.cmi.wuzhenzhou.singleton;

public class Marshal {
	public static final int N = 10;
	private static Marshal[] instance = new Marshal[N]; 
	protected static int num = 0;
	
	private String name;
	
	private Marshal(String name) {
		this.name = name;
	}
	
	public String getName() {
		return this.name;
	}
	
	public static Marshal getInstance(String name) {
		if(num < N) {
			if(instance[num] == null && !name.equals(null))
				instance[num++] = new Marshal(name);
			return instance[num - 1];
		}else {
			return null;
		}
	}
}
